<<<<<<< HEAD
# -*-  coding:utf-8 -*- 
# Author : lihongliang


print("==============第二堂课 关系测试 交集，差集，并集============")

iphone7 = {'alex','rain','jack','old_driver','iphone777'}
iphone8 = {'alex','jack','shanshan','old_boy','iphone888'}


print("==============交集============")
a= iphone7.intersection(iphone8)
print(a)
a= iphone7 & iphone8
print(a)
print("==============差集============")
b= iphone7.difference(iphone8)
print(b)
b = iphone7- iphone8
print(b)

print("==============并集============")
c = iphone7.union(iphone8)
print(c)
c = iphone7|iphone8
print(c)

print("==============对称差集============")
d = iphone8.symmetric_difference(iphone7)
print(d)

print("==============包含关系超集，子集============")
a = {1,2,3,4,5,6}
b ={1,2,3}

print(a.issubset(b))     # a<=b
print(a.issuperset(b))   # a>=b

print(b.issubset(a))
print(b.issuperset(a))

print("==============判断集合是不是   不相交============")
print(a.isdisjoint(b))

print("==============in，not in 判断元素是否在集合内============")
print(2 in a)
print(23 in a)
print("==============   ==，!= 判断两个集合是否相等 ============")

print(a == b)
=======
# -*-  coding:utf-8 -*- 
# Author : lihongliang


print("==============第二堂课 关系测试 交集，差集，并集============")

iphone7 = {'alex','rain','jack','old_driver','iphone777'}
iphone8 = {'alex','jack','shanshan','old_boy','iphone888'}


print("==============交集============")
a= iphone7.intersection(iphone8)
print(a)
a= iphone7 & iphone8
print(a)
print("==============差集============")
b= iphone7.difference(iphone8)
print(b)
b = iphone7- iphone8
print(b)

print("==============并集============")
c = iphone7.union(iphone8)
print(c)
c = iphone7|iphone8
print(c)

print("==============对称差集============")
d = iphone8.symmetric_difference(iphone7)
print(d)

print("==============包含关系超集，子集============")
a = {1,2,3,4,5,6}
b ={1,2,3}

print(a.issubset(b))     # a<=b
print(a.issuperset(b))   # a>=b

print(b.issubset(a))
print(b.issuperset(a))

print("==============判断集合是不是   不相交============")
print(a.isdisjoint(b))

print("==============in，not in 判断元素是否在集合内============")
print(2 in a)
print(23 in a)
print("==============   ==，!= 判断两个集合是否相等 ============")

print(a == b)
>>>>>>> dev
print(a != b)